
const domainName = getApp().globalData.domainName
const dataType = 'json'
const header = {'content-type':'application/x-www-form-urlencoded'}
const method = 'POST'
const responseType = 'text'


  
  // 加载权限列表
const load_list=(that,section_id)=>{
    wx.request({
      url: domainName + '/section_load_tiList_of_sec',
      data: {section_id:section_id},
      dataType: dataType,
      enableCache: true,
      enableHttp2: true,
      enableQuic: true,
      header: header,
      method: method,
      responseType: responseType,
      timeout: 0,
      success: res => {
        that.setData({
          list:res.data.list,
        })
      },
    })
  }

const delete_ti=(that, ti_id)=>{
  wx.request({
    url: domainName + '/section_delete_ti',
    data: {
      ti_id:ti_id,
    },
    dataType: dataType,
    enableCache: true,
    enableHttp2: true,
    enableQuic: true,
    header: header,
    method: method,
    responseType: responseType,
    timeout: 0,
    success: res => {
      wx.showToast({
        title: '删除完成',
        duration: 1500,
        icon: 'success',
        mask: false,
      })
      load_list(that, that.options.sec_id)
    },
  })
}

module.exports={
  load_list:load_list,
  delete_ti:delete_ti,
}